home *** CD-ROM | disk | FTP | other *** search
-
- import java.awt.*;
-
- /**
- * @author Arthur van Hoff
- */
-
- public class WhatsNew extends java.applet.Applet implements Runnable {
- Image imgs[];
- int current;
- Thread blinker;
-
- public void start() {
- imgs = new Image[2];
- imgs[0] = getImage(getCodeBase(), "whatsnew1.gif");
- imgs[1] = getImage(getCodeBase(), "whatsnew2.gif");
-
- blinker = new Thread(this);
- blinker.start();
- }
- public void stop() {
- blinker.stop();
- }
- public void run() {
- try {
- while (true) {
- repaint();
- current = 0;
- Thread.sleep(1000);
- current = 1;
- repaint();
- Thread.sleep(500);
- }
- } catch (InterruptedException e) {
- }
- }
- public void paint(Graphics g) {
- Dimension d = size();
- g.drawImage(imgs[current], 0, 0, d.width, d.height, this);
- }
- }
-